<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("编辑会员")}</title>
<link href="/resources/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/resources/js/reference/jquery.js"></script>
<script type="text/javascript"
	src="/resources/js/reference/jquery.validate.js"></script>
<script type="text/javascript" src="/resources/js/base/dialog.js"></script>
<script type="text/javascript" src="/resources/js/base/request.js"></script>
<script type="text/javascript" src="/resources/js/base/global.js"></script>
<script type="text/javascript"
	src="/resources/plugin/datePicker/WdatePicker.js"></script>
<link href="/resources/css/mmGrid.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/resources/js/reference/mmGrid.js"></script>
<script src="/resources/js/base/file.js"></script>
<script type="text/javascript">
$().ready(function() {
	$("#password").val("");
	var $inputForm = $("#inputForm");

	// 表单验证
	$inputForm.validate({
		rules: {
			mobile: {
				required:true
			},
			password: {
				pattern: /^[^\s&\"<>]+$/,
				minlength: ${setting.passwordMinLength},
				maxlength: ${setting.passwordMaxLength}
			},
			rePassword: {
				equalTo: "#password"
			}
		},
		messages: {
			password: {
				pattern: "${message("非法字符")}"
			},
			pinCode: {
				pattern: "${message("非法字符")}"
			},
			operatePassword: {
				pattern: "${message("非法字符")}"
			}
			[#if !setting.isDuplicateEmail]
				,email: {
					remote: "${message("已存在")}"
				}
			[/#if]
		},
		submitHandler:function(form){
			return false;
		}
	});
	
	var terminalInItemIndex = 0;
	 [#if terminals!=null]
		var terminals = ${terminals};
	[#else]
		var terminals = {};
	[/#if]
	var cols = [				
   	{ title:'${message("终端设备编号")}', name:'terminalNum' ,align:'center', width:110, renderer: function(val,item,rowIndex, obj){
			var	html = '<input type="hidden" name="terminalId" class="terminalId terminalId_'+item.id+'" value="'+item.id+'" />'+val;
			return html;}
		},
   	{ title:'${message("终端名称")}', name:'terminalName' ,align:'center', width:110},
   	{ title:'${message("终端SIM卡号")}', name:'sim' ,align:'center', width:110},
		{ title:'${message("操作")}', align:'center', width:60, renderer:function(val,item){
		terminalInItemIndex++;
		return '<a href="javascript:;" class="deleteTerminal btn-delete">删除</a>';
		}},
	];
	var $tmGrid=$('#table-terminal').mmGrid({
		fullWidthRows:true,
		height:'auto',
       cols: cols,
       checkCol: false,
       items:terminals,
       autoLoad: true,
   });
	
	//查询机构
	$("#selectSaleOrg").bindQueryBtn({
		type:'saleOrg',
		title:'${message("查询机构")}',
		url:'/saleOrg/select_saleOrg.jhtml'
	});	
	
	$("form").bindAttribute({
		callback: function(msgResult){
			cancle_iframe()
		}
	});
	
	$("form").bindAttribute({
		isConfirm:true,
	    callback: function(resultMsg){
	        $.message_timer(resultMsg.type,resultMsg.content,1000,function(){
				location.reload(true);
			});
	    }
	 });
});

//
</script>
</head>
<body>
	<div class="pathh">&nbsp;${message("查看用户")}</div>
	<form id="inputForm" action="update_info.jhtml" method="post"
		type="ajax" validate-type="validate">
		<input type="hidden" name="id" value="${member.id}" />
		<ul id="tab" class="tab">
			<li><input type="button" value="${message("
				12133")}" class="current" /></li>
		</ul>
		<div class="tabContent">
			<table class="input input-edit">
				<tr>
					<th>${message("15023")}:</th>
					<td>${member.username}</td>
					<th><span class="requiredField">*</span>${message("手机")}:</th>
					<td>${member.mobile}</td>
					<th>${message("登录密码")}:</th>
					<td><span class="error-msg"><input type="text"
							id="password" name="password" value="" class="text"
							maxlength="20" btn-fun="clear" autocomplete="off"
							onfocus="this.type='password'" /></span></td>
					<th>${message("确认登录密码")}:</th>
					<td><span class="error-msg"><input type="text"
							name="rePassword" class="text" maxlength="20" btn-fun="clear"
							autocomplete="off" onfocus="this.type='password'" /></span></td>
				</tr>
				<tr>
					<th><span class="requiredField"></span>${message("机构")}:</th>
					<td><span class="search" style="position: relative"> 
						<input type="hidden" name="saleOrgId" class="text saleOrgId"
							btn-fun="clear" [#if saleOrg??]value="${saleOrg.id}" [/#if]/> 
						<input type="text" name="saleOrgName" class="text saleOrgName"
							maxlength="200" onkeyup="clearSelect(this)"
							value="[#if saleOrg??]${saleOrg.name}[/#if]" readOnly /> 
						<input type="button" class="iconSearch" value="" id="selectSaleOrg"></span>
					</td>
					<th>${message("姓名")}:</th>
					<td><input type="text" name="name" class="text"
						value="${member.name}" maxlength="200" btn-fun="clear" /></td>
					<th>${message("用户类型")}:</th>
					<td>${message("业务系统用户")}</td>
				</tr>
				<!-- <tr>
				<th>${message("头像")}</th>
				<td colspan="7"><input type="hidden" name="imageName" value="${member.imageName}" ></td>
			</tr> -->
				<tr class="border-L2">
					<th>${message("操作终端设备")}:</th>
					<td colspan="7"></td>
				</tr>
				<tr class="border-L2">
					<td colspan="8">
						<div>
							<table id="table-terminal"></table>
						</div>
					</td>
				</tr>
				</tr>
			</table>
		</div>
		<div class="fixed-top">
			<input type="submit" id="submit_button" class="button sureButton"
				value="${message("保存")}" /> <input type="button"
				class="button backButton" value="${message("
				关闭")}" onclick="cancle_iframe();" />
		</div>
	</form>
</body>
</html>